package org.example.ReflectDemo.proxy;

import net.sf.cglib.proxy.Enhancer;

public class Main {
    public static void main(String[] args) {
        HouseSubject houseSubject = new RealHouseSubject();
        HouseSubject proxy= (HouseSubject) Enhancer.create(houseSubject.getClass(),new CglibMethodInterceptor(houseSubject));
        proxy.saleHouse();
        proxy.rentHouse();
    }
}
